﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using IDAL;
using System.Reflection;

namespace DalFactory
{
    public partial class AbstractFactory
    {
        private static readonly string dalPath = ConfigurationManager.AppSettings["dalPlace"];
        private static readonly string dalNamePlace = ConfigurationManager.AppSettings["dalNamePlace"];
        //public static IUserInfosDAL CreateIUserInfosDAL()
        //{
        //    string fullClassName = dalNamePlace + ".UserInfoDAL";
        //    return CreateInstance(fullClassName) as IUserInfosDAL;
        //}
		
        private static object CreateInstance(string className)
        {
            Assembly buffAssembly = Assembly.Load(dalPath);
            return buffAssembly.CreateInstance(className);
        }
    }
}
